//
//  YCSegmentPageVC.h
//  YCSegmentPage
//
//  Created by tangkexiong on 16/3/14.
//  Copyright © 2016年 tangkexiong. All rights reserved.
//

#import <UIKit/UIKit.h>

#pragma mark - YCSegmentPageVCHeaderView

@interface YCSegmentPageVCHeaderView : UIView

@property (nonatomic, strong) UIImageView *imgView;

@end

#pragma mark - YCSegmentPageVCSegmentView

@interface YCSegmentPageVCSegmentView : UIView

@property (nonatomic, strong, readonly) UISegmentedControl *segmentCtrl;

@end

#pragma mark - YCSegmentPageVC

@class YCSegmentPageVC;

@protocol YCSegmentPageVCDataSource <NSObject>

@required
- (NSInteger)numberOfSegmentsInSegmentPageVC:(YCSegmentPageVC *)vc;
@optional
- (CGFloat)heightOfHeaderViewInSegmentPageVC:(YCSegmentPageVC *)vc;
- (YCSegmentPageVCHeaderView *)headerViewInSegmentPageVC:(YCSegmentPageVC *)vc;
- (CGFloat)heightOfSegmentViewInSegmentPageVC:(YCSegmentPageVC *)vc;
- (YCSegmentPageVCSegmentView *)segmentViewInSegmentPageVC:(YCSegmentPageVC *)vc;
- (CGFloat)minTopOffsetOfSegmentViewInSegmentPageVC:(YCSegmentPageVC *)vc whileOrientation:(UIInterfaceOrientation)orientation;

- (NSString *)titleOfSegmentInSegmentPageVC:(YCSegmentPageVC *)vc atIndex:(NSInteger)index;
- (UIViewController *)contentVCInSegmentPageVC:(YCSegmentPageVC *)vc atIndex:(NSInteger)index;
- (UIScrollView *)scrollViewInSegmentPageVC:(YCSegmentPageVC *)vc atIndex:(NSInteger)index;

@end

@protocol YCSegmentPageVCDelegate <NSObject>

- (void)segmentPageVC:(YCSegmentPageVC *)vc didChangeTopOffset:(CGFloat)topOffset;

@end

/**
 *  SegmentCtrl作为标签
 */
@interface YCSegmentPageVC : UIViewController

/// 配置
@property (nonatomic, weak) id<YCSegmentPageVCDataSource> dataSource;
/// 代理
@property (nonatomic, weak) id<YCSegmentPageVCDelegate> delegate;

@property (nonatomic, weak, readonly) UIViewController *curContentVC;
@property (nonatomic, strong, readonly) YCSegmentPageVCHeaderView *headerView;
@property (nonatomic, strong, readonly) YCSegmentPageVCSegmentView *segmentView;

@end
